<%@page import="merlin.beans.ReportTitlesBean"%>
<%@page import="merlin.managers.ReportTitlesManager"%>
<%@page import="merlin.utils.MerlinUtilities"%>


<%
		
	String grp = request.getParameter("grp");
	String kw = request.getParameter("kw");
	
	if(! MerlinUtilities.isInteger(grp) || MerlinUtilities.isEmpty(kw)){
		out.println("<h3>Invalid parameters</h3>");
		return;
	}

	int reportNumber = Integer.parseInt(grp);
	String companyNumber = kw;
	
	// Get the report details.
	ReportTitlesBean report = ReportTitlesManager.selectReportTitlesByPK(new ReportTitlesBean(reportNumber));
	
%>
	
<html>
	<head>
		<meta charset="utf-8"/>
		<meta content="IE=edge, chrome=1" http-equiv="X-UA-Compatible"/>
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		
		<!-- Bootstrap CSS -->
		<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
		<link href="includes/css/bootstrap-glyphicons.css" rel="stylesheet">
		
		<!-- Custom CSS -->
		<link rel="stylesheet" href="includes/css/styles.css">
			
		<!-- Include Modernizr in the head, before any other Javascript -->
		<script src="includes/js/modernizr-2.6.2.min.js"></script>
		
		<!-- Bootstrap JS -->
		<script src="bootstrap/js/bootstrap.min.js"></script>

		<!-- begin DWR imports -->
		<script type='text/javascript' src='dwr/interface/WebsiteEnquiriesManager.js'></script>
		<script type='text/javascript' src='dwr/engine.js'></script>
		<script type='text/javascript' src='dwr/util.js'></script>
		<!-- ends DWR imports -->
	
		<!-- begin jQuery import -->
		<script type='text/javascript' src='mr_scripts/jquery.js'></script>
		<!-- ends jQuery import -->
		
		</script>
		<% 
			if(report != null) {
				String reportNameUpperCase = report.getReportTitle().toUpperCase();
				String reportNameLowerCase = report.getReportTitle().toLowerCase();
				String reportNameTitleCase = MerlinUtilities.capitalizeFully(report.getReportTitle());
		%>
		<title>Check your email now for link to free <%=reportNameTitleCase%> Report </title>
		<%
				} else {
					out.println("<h3>No report found !</h3>");
				}
		%>
	</head>
	<body>
		<div class="container">
			<div class="navbar navbar-fixed-top">
				<div class="navbar-custom">
					<div class="container">
						<a class="navbar-brand" href="#"><img class="img-responsive" src="images/Merlin.png" alt="Merlin Scott  Logo"></img></a>
					</div><!--end container-->
				</div><!--end navbar-inner-->
			</div><!--end navbar-->
		</div>
		
		<% 
			if(report != null) {
				String reportNameUpperCase = report.getReportTitle().toUpperCase();
				String reportNameLowerCase = report.getReportTitle().toLowerCase();
				String reportNameTitleCase = MerlinUtilities.capitalizeFully(report.getReportTitle());
		%>
		<div class="container">
			<div class="row">
				<div class="col-12">
					<div class="header centered" id="thanks">
						<h2>I have just sent you an email with the Download Link to the free report on the <%=reportNameTitleCase %> sector. Please check your firewall if you do not receive my email message.</h2>
					</div><!--end header centerer-->
				</div><!--end col-12-->
			</div><!--end row-->
		</div><!--end container-->
		<%
				} else {
					out.println("<h3>No report found !</h3>");
				}
		%>
	</body>
</html>